package com.hrbxlh.virtualization.converter;

import com.hrbxlh.virtualization.dto.ClusterDTO;
import com.hrbxlh.virtualization.pojo.Cluster;
import com.hrbxlh.virtualization.vo.ClusterVO;
import org.springframework.beans.BeanUtils;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

/**
 * @author cheer
 */
@Component
public class ClusterToClusterVOConverter implements Converter<Cluster, ClusterVO> {

    @Override
    public ClusterVO convert(Cluster cluster) {
        ClusterVO clusterVO = new ClusterVO();
        BeanUtils.copyProperties(cluster, clusterVO);
        clusterVO.setName(cluster.getClusterName());
        return clusterVO;
    }
}
